package com.lanswon.qzsmk.util;

import java.io.IOException;
import java.util.HashMap;
import java.util.Properties;

public class KmssProperties {

	private static HashMap<String, Object> mgrs = new HashMap<String, Object>();
	private Properties properties=null;
	
	
	public static synchronized KmssProperties getInstance(String name) {
		Object item = mgrs.get(name);
		return item == null ? new KmssProperties(name) : (KmssProperties) item;
	}
	
	private KmssProperties(String name) {
		this.properties = new Properties();
		try {
			this.properties.load(ConnectionPoolUtil.class.getClassLoader()
					.getResource("conf/"+name+".properties").openStream());
		} catch (IOException arg2) {
			arg2.printStackTrace();
		}
	}
	
	public String getProperty(String propName) {
		return this.properties.getProperty(propName);
	}
	
	public static void main(String[] args) {
		KmssProperties manager = getInstance("KmssClient");
	String user = manager.getProperty("MidWareTime");
	System.out.println("user>>>>>>>>>>>>>>>>>>"+user);
	}
}
